package com.ailink.design.pattern.strategy;

/**
 * Created by Administrator on 2018/9/21
 */
public abstract class Duck {

    private FlyingStrategy flyingStrategy;

    public void quack() {
        System.out.println("嘎嘎嘎");
    }

    public abstract void display();

    public void setFlyingStrategy(FlyingStrategy flyingStrategy) {
        this.flyingStrategy = flyingStrategy;
    }

    public void fly() {
        flyingStrategy.performFly();
    }
}
